package net.wofly.sale.stock.service;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import net.wofly.framework.util.ReturnBean;
import net.wofly.sale.stock.domain.InStock;
import net.wofly.sale.stock.domain.ResourceAsk;

public interface IInStockService {

	/**
	 * 增加或修改
	 * 
	 * @param entity
	 * @return
	 */
	public InStock save(InStock entity);

	/**
	 * 删除
	 * 
	 * @param entity
	 * @return
	 */
	public void delete(InStock entity);

	/**
	 * 根据主键ID删除
	 * 
	 * @param key
	 * @return
	 */
	public void delete(String key);

	/**
	 * 根据主键查询
	 * 
	 * @param key
	 * @return
	 */
	public InStock findOne(String key);
	
	public Page<InStock> findAll(Specification specification, Pageable pageable);
	
	public List<InStock> save(List<InStock> entityList) ;
	
	/**
	 * 通过领料申请的入库流水
	 * 完成入库流水同时需要修改申请人库存
	 * 
	 * 
	 * @param ra
	 */
	public ReturnBean<String> inStockFromResourceAsk(ResourceAsk ra) ;

}
